Files and File Operations
Slides
A PDF file of the lecture slides handout.
Reading
Think Python (3rd edition), Ch. 13: Files and Databases (only sections 13.1 and 13.2)
Think Python (2nd edition): Chapter 14: Files (only sections 14.1, 14.2, 14.4, 14.5) You should ignore section 14.3 Format Operator, since it is superseded by the more advanced f-string construct described in Sec 13.2 of the 3rd edition
Code
Click on the lec14_files.zip link to download
the .zip
file to your computer.
The unzipped folder contains the notebook for lecture activities.
Solutions (for after class)
Use these sample solutions for review only after you have completed the code exercises. You will learn much more by trying to solve them on your own and then comparing your approach with the solutions.
Study Guide
- Study Guide #8 (Files, Exceptions, List Comprehensions, and Sorting)
- Study Guide #8 (Files, Exceptions, List Comprehensions, and Sorting) Solutions